package cn.azy.websocket.tool;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;

/**
 * @ Author     ：AZY.
 * @ Date       ：Created in 14:40 2019/9/3
 * @ Description：接收外部消息
 */
@RestController
@RequestMapping("websocket")
public class WebSocketController {

    @GetMapping("sendmsg")
    public void getMsg(@RequestParam("msg")String msg,@RequestParam("username")String username) throws IOException {
        WebSocketServer.sendInfo("来自activeMQ消费者消息: " + msg,username);
    }
}
